<cfsetting enablecfoutputonly="yes">

<cfparam name="attributes.url" default="#application.xtiurl#">
<cfparam name="attributes.dtd" default="#application.xtidtd#">
<!--- <cfparam name="attributes.product_code"> --->
<cfparam name="attributes.debug" default="false">
<cfparam name="attributes.debuglevel" default="1,2,3">
<!--- ARRAY PARTS --->
<cfparam name="attributes.array_parts" default="">
<cfparam name="attributes.array_systems" default="">
<!--- ---------------------------------------------------------------------------
Build the xml request doc  for our good middle ware friends Then post that puppy
to those middleware gurus.  Notice each system will need a specific post.--->
<cfset var.MaxEnd = CreateODBCdateTime(now())>
<cfscript>
cart = "";
subtotal = 0;
// Start with standalone parts
if  (isarray(attributes.array_parts) and arraylen(attributes.array_parts) GT 0) {
	indexcnt = arraylen(attributes.array_parts) + 1;
	for ( i=1; i lt indexcnt ; i=i+1) {
      cart = cart & '
         <line_item>
            <product>
               <product_code>#ucase(attributes.array_parts[i].product)#</product_code>
            </product>
         </line_item>      ';
	}
}

// Now throw the entire xml string together... 
xml = 
'<!DOCTYPE copy SYSTEM "#attributes.dtd#">
<xtiinput>
   <inputheader>
      <actionset>
      <action>stock_status</action>
      </actionset>
   </inputheader>
   <inputdata>
      <shopping_cart>      #cart#
      </shopping_cart>
   </inputdata>
</xtiinput>';
</cfscript>